class CreateDefaultAdmin < ActiveRecord::Migration
  def self.up
    # generate default Roles  
	 Role.create(:rolename => 'manager')
	 Role.create(:rolename => 'player')
    # add default user 
    user = User.new
    user.name = "Bryan Buchs"
    user.email = "bryan@bryanbuchs.com"
    user.password = "admin"
    user.password_confirmation = "admin"
    user.save(false)
    user.send(:activate!)

  end

  def self.down
    Role.find_by_rolename('administrator').destroy    
    User.find_by_email('bryan@bryanbuchs.com').destroy
  end
end
